<div id="container">
    <div class="container">
        <h1 class="lib-config">远程NAS源</h1>
        <p>
            指定网络中共享歌曲文件的远程主机计算机路径。
            保存或删除远程NAS源后，请返回播放或库，从菜单中选择“更新库”。
        </p>
        <form class="form-horizontal" action="lib-config.php" method="post">
            <legend>远程主机</legend>
            <button class="legend-config btn btn-medium btn-primary btn-submit" type="submit" name="save_nas_source" value="1">保存</button>
            <a href="#remove-nas-source" data-toggle="modal" class="$_hide_remove_nas_source"><button class="legend-config btn btn-medium btn-primary">删除</button></a>
        </legend>
        <a data-toggle="modal" href="#moode-log" $_hide_nas_mount_error>
            <button class="btn btn-medium btn-primary config-btn">$_nas_mount_error_msg</button>
        </a>
        <div class="control-group">
            <label class="control-label" for="type">类型</label>
            <div class="controls">
                <select id="type" name="mount[type]" class="config-select-large">
                    $_protocol
                </select>
                <a aria-label="帮助" class="config-info-toggle" data-cmd="info-fileshare-protocol" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
                <div id="info-fileshare-protocol" class="config-help-info">
                    选择对应于远程主机上使用的文件共享协议的类型。注意NFS挂载失败可能导致长达2分钟的超时。此屏幕在这种情况下会看起来卡住。
                </div>
            </div>
            <label class="control-label" id="server-label" for="address">路径</label>
            <div class="controls">
                <select id="address" name="mount[address]" class="config-select-large">
                    $_address
                </select>
                <button id="scan-btn" class="btn btn-primary btn-small config-btn-set btn-submit status-msg $_scan_btn_hide" data-msg="扫描中" type="submit" name="scan" value="1">扫描</button>
                <a aria-label="帮助" class="config-info-toggle" data-cmd="info-server" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
                <div id="info-server" class="config-help-info">
                    SCAN生成一个包含网络中发现的SMB或NFS共享列表。路径由主机或IP地址、斜杠和共享名组成，例如SomeHost/ShareName。
                </div>
                <div id="edit-server" $_edit_server_hide>
                    <a id="editserver" data-toggle="modal" href="#manual-server"><button class="btn btn-medium btn-primary config-btn">编辑</button></a>
                    <div class="config-btn-after">手动路径</div>
                </div>
            </div>
        </div>
        <div id="userid-password" class="$_userid_pwd_hide">
            <label class="control-label" for="nas-usr">用户ID</label>
            <div class="controls">
                <input  id="nas-usr" class="config-input-large" type="text" pattern="[^'\u0022]+" name="mount[username]" value="$_username">
                <a aria-label="帮助" class="config-info-toggle" data-cmd="info-nas-uidpwd" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
            </div>
            <label class="control-label" for="nas-pasw">密码</label>
            <div class="controls">
                <input  id="nas-pasw" class="config-input-large" type="password" pattern="[^'\u0022]+" name="mount[password]" value="$_password" autocomplete="off">
                <a aria-label="帮助" class="config-info-toggle" data=cmd=info&nas=uidpwd&href=#notarget"><iclass='fa regular fa sharp fa info circle'></i></a>
                <a href="#notarget" data='id=nas&pasw'><iclass='fa regular fa sharp fa eye'></i></a>
                <div id='infonasuidpwd'class='confighelpinfo'>尝试使用Guest用户ID和空密码，除非您的NAS设备要求特定的用户ID/密码。注意不允许使用单引号和双引号。</div>
            </div>
        </div>
       <label class="control-label" for="options">挂载选项</label>
<div class="controls">
    <input class="config-input-large" type="text" id="options" name="mount[options]" value="$_options">
    <span id="info-mount-flags" class="config-help-static">
        大多数挂载选项在挂载时会自动协商，但在某些情况下，自动协商无法确定正确的值，挂载可能会失败。在这种情况下，某些选项必须显式添加。以下是一些列出的选项。<br>
        SMB: vers=x.y, sec=ntlm 或 sec=ntlmssp<br>
        NFS: vers=x.y, type=nfs2, nfs3 或 nfs4
    </span>
</div>
</div>
</div>
</form>
</div>
</div>

<form class="form-horizontal" method="post">
    <div id="remove-nas-source" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="remove-nas-source-label" aria-hidden="true">
        <div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h3>删除 NAS 源: $_name?</h3>
        </div>
        <div class="modal-body"></div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
            <button class="btn btn-primary btn-submit" type="submit" name="remove_nas_source" value="1">是</button>
        </div>
    </div>
</form>

<div id="moode-log" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="moode-log-label" aria-hidden="true">
    <div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3>Moode 日志</h3>
    </div>
    <div class="modal-body">
        <pre>
            $_moode_log
        </pre>
    </div>
    <div class="modal-footer">
        <button class="btn singleton" data-dismiss="modal" aria-hidden="true">关闭</button>
    </div>
</div>

<form class="form-horizontal" method="post">
    <div id="manual-server" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="manual-server-label" aria-hidden="true">
        <div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h3>手动路径输入</h3>
        </div>
        <div class="modal-body">
            <label class="control-label" for="manualserver">路径</label>
            <div class="controls">
                <input id="manualserver" class="config-input-xlarge config-modal-input" type="text" pattern="^[A-Za-z0-9]{1,1}.*$" name="nas_manualserver" value="" autofocus>
                <input id="mounttype" type="hidden" name="mounttype" value="">
                <div id="info-manualserver" class="help-block" style="margin-top:5px;">
                    格式为 Host/Share 或 IPaddr/Share。最长 64 个字符，不允许前导斜杠 /。
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
            <button class="btn btn-primary btn-submit" type="submit" name="manualentry" value="1">确定</button>
        </div>
    </div>
</form>
